<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
define('WEB_DIR', '../../' . DIRECTORY_SEPARATOR);
require  WEB_DIR . '../processor/lib/common.php';

include_once  'sdk/acp_service.php';

if (com\unionpay\acp\sdk\AcpService::validate ( $_POST ))
 {
	//商户订单号
	$sn = $_POST['orderId'];

	//交易号
	$trade_no = $_POST['queryId'];

	//交易状态
	$trade_status = $_POST ['respCode']; //判断respCode=00或A6即可认为交易成功
	
	//金额
	$money = $_POST['txnAmt'];
	
	if ($trade_status== '00' || $trade_status== 'A6')
	 {
		//付款完成后
		YF_f::initC('\c\shop\pay')->auto_payed($sn, $money, $trade_no);
	 }	
 }
 else
	url::jump(ROOT_URL);
